# $Id: PKGBUILD 87955 2013-04-09 11:17:26Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=ejabberd-mod_archive-svn
pkgver=1137
pkgrel=1
pkgdesc="ejabberd message archive module"
arch=(any)
url="http://www.ejabberd.im/mod_archive"
license=('GPL')
depends=(ejabberd)
makedepends=(erlang subversion)
options=()
source=("ejabberd-modules.svn::svn+https://svn.process-one.net/ejabberd-modules"
	"types-fix.patch")
md5sums=('SKIP'
         '2fed1281e5ad78b20b753c705d3ec314')

build() {
  cd $srcdir/ejabberd-modules.svn/mod_archive/trunk
  patch -p0 <$srcdir/types-fix.patch
  ./build.sh
  rm -rf ebin/.svn
}

package() {
  cd $srcdir/ejabberd-modules.svn/mod_archive/trunk
  install -d -m 0755 $pkgdir/usr/lib/ejabberd
  cp -r ebin $pkgdir/usr/lib/ejabberd/ebin
  install -d -m0755 $pkgdir/usr/share/ejabberd-mod_archive
  cp -r src/*.sql $pkgdir/usr/share/ejabberd-mod_archive/
}
